home *** CD-ROM | disk | FTP | other *** search
/ Champak 62 / Volume 62 - JOGO DISK .iso / Games / mycutepets.swf / scripts / __Packages / tool.as < prev   
Text File  |  2008-03-17  |  1KB  |  61 lines

  1. class tool extends MovieClip
  2. {
  3.    var _using = false;
  4.    function tool()
  5.    {
  6.       super();
  7.       this.__set__active(false);
  8.    }
  9.    function set active(bool)
  10.    {
  11.       this.mov2tg.removeMovieClip();
  12.       if(bool)
  13.       {
  14.          this._parent[this.mov1]._visible = false;
  15.          this.mov2tg = this._parent.attachMovie(this.mov2,"tool_" + this.id,this.id,{_x:this._parent._xmouse,_y:this._parent._ymouse});
  16.          this.mov2tg.startDrag(true);
  17.       }
  18.       else
  19.       {
  20.          this._parent[this.mov1]._visible = true;
  21.       }
  22.    }
  23.    function get acitve()
  24.    {
  25.       return this._act;
  26.    }
  27.    function set using(bool)
  28.    {
  29.       if(bool)
  30.       {
  31.          this._parent[this.mov1]._visible = false;
  32.          this.mov2tg.removeMovieClip();
  33.       }
  34.       else
  35.       {
  36.          this._parent[this.mov1]._visible = true;
  37.       }
  38.       this._using = bool;
  39.    }
  40.    function get using()
  41.    {
  42.       return this._using;
  43.    }
  44.    function onPress()
  45.    {
  46.       if(!this.__get__using())
  47.       {
  48.          this.sound.playSound();
  49.          this._parent.game.tool = this;
  50.       }
  51.    }
  52.    function onRelease()
  53.    {
  54.       this._parent.game.tool = null;
  55.    }
  56.    function onReleaseOutside()
  57.    {
  58.       this.onRelease();
  59.    }
  60. }
  61.